<template>
	<view class="verified">
		<view class="suggestContent">
			<input
				type="text"
				:value="userInfo.truename"
				placeholder="请输入姓名"
				placeholder-class="input-empty"
				maxlength="20"
				data-key="truename"
				style="height:32px"
			/>
		</view>
		<view class="suggestContent">
			<input
				type="text"
				:value="userInfo.identityno"
				placeholder="请输入身份证号"
				placeholder-class="input-empty"
				maxlength="18"
				data-key="identityno"
				style="height:32px"
			/>
		</view>
		
		<text class="recharge-text">重要提醒：一个身份证号只能绑定一个账号</text>
		
		<!-- <view class="qrinfo">
			<text class="qrtext"  @click="navToHref">在线实名认证二维码</text>
			<image class="bg" :src="userInfo.verified_href || '/static/images/identityafter.png'"></image>
		</view> -->
		
	</view>
</template>

<script>
export default {
	data() {
		return {
			token: '',
			userInfo: {}
		};
	},
	onLoad() {
		
	},
	onShow() {
		this.token = this.$api.get('token');
		if (!this.token) {
			uni.navigateTo({
				url: '/pages/public/login'
			});
			return;
		}
		
		//获取用户信息
		this.getmedate();
	},
	navToHref: function() {
		let openUrl = 'http://freelance.youfupingtai.com/gotoSign.do';
		
		// #ifdef APP-PLUS
		plus.runtime.openURL(openUrl);
		// #endif
		
		// #ifdef H5
		windows.location.href = openUrl;
		// #endif
	},
	methods: {
		//获取用户信息
		async getmedate() {
			console.log('/pages/user/user');
			const param_userinfo = {
				token: this.token
			};
			console.log('User/userinfo', param_userinfo);
			await this.$http.request('User', 'userinfo', 'GET', param_userinfo, (res) => {
				console.log('User/userinfo', res);
				if (res.status == 1) {
					if (res.data.error == 0) {
						console.log('userinfo', res.data.data);
						this.userInfo = res.data.data;
					}
				}
			});
		},
	}
};
</script>

<style lang="scss" scoped>
.verified {
	
	.suggestContent {
		border-radius: 15upx;
		padding: 2upx;
		margin: 20upx 20upx;
		background: #efefef;
		
		.bg {
			width: 100%;
			height: 400upx;
			filter: blur(1px);
			opacity: 0.7;
		}
	}
	
	.exit-button{
		margin-top: 30upx;
		
		.exit-button-text {
			height: 76upx;
			line-height: 76upx;
			margin: 0upx 20upx;
			border-radius: 10px;
			background: $uni-color-primary;
			color: #fff;
			font-size: $font-lg;
		}
	}
	
	.recharge-text {
		display: block;
		padding: 16upx 20upx;
		color: #fa436a;
		font-size: 24upx;
	}
	
	.qrinfo {
		padding: 10upx;
		margin: 20upx 20upx;
		background: #efefef;
		text-align: center;
		
		.qrtext{
			display: block;
			padding: 16upx 20upx;
			color: #fa436a;
			font-size: 34upx;
		}
		
		.bg {
			width: 400upx;
			height: 400upx;
			opacity: 0.7;
		}
	}

	
}
</style>
